package com.supersonic.backend.model;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
@Entity
public class Job extends BaseModel{

	@ManyToOne(cascade = CascadeType.ALL,fetch=FetchType.LAZY)
	private CommonUser sender;

	@ManyToOne(cascade = CascadeType.ALL,fetch=FetchType.LAZY)
	private CommonUser receiver;

	@ManyToOne(cascade = CascadeType.ALL,fetch=FetchType.LAZY)
	private Address pickupAddress;

	@ManyToOne(cascade = CascadeType.ALL,fetch=FetchType.LAZY)
	private Address dispatchAddress;

	@ManyToOne(cascade = CascadeType.ALL,fetch=FetchType.LAZY)
	private Deliver pickupDeliver;

	@ManyToOne(cascade = CascadeType.ALL,fetch=FetchType.LAZY)
	private Deliver dispatchDeliver;

	@OneToOne(cascade = CascadeType.ALL,fetch=FetchType.LAZY)
	private LogisticsTask task;
	
	@ManyToOne(cascade = CascadeType.ALL,fetch=FetchType.LAZY)
	private JobStatus status;

	private String tag;

	private float rate;

	private String comment;

	private double weight;

	private int itemAmount;

	private String trackNo;

	@ManyToOne
	private ItemType itemType;

	private Date pickupDateTime;

	/**
	 * @return the sender
	 */
	public CommonUser getSender() {
		return sender;
	}

	/**
	 * @param sender the sender to set
	 */
	public void setSender(CommonUser sender) {
		this.sender = sender;
	}

	/**
	 * @return the receiver
	 */
	public CommonUser getReceiver() {
		return receiver;
	}

	/**
	 * @param receiver the receiver to set
	 */
	public void setReceiver(CommonUser receiver) {
		this.receiver = receiver;
	}

	/**
	 * @return the pickupAddress
	 */
	public Address getPickupAddress() {
		return pickupAddress;
	}

	/**
	 * @param pickupAddress the pickupAddress to set
	 */
	public void setPickupAddress(Address pickupAddress) {
		this.pickupAddress = pickupAddress;
	}

	/**
	 * @return the dispatchAddress
	 */
	public Address getDispatchAddress() {
		return dispatchAddress;
	}

	/**
	 * @param dispatchAddress the dispatchAddress to set
	 */
	public void setDispatchAddress(Address dispatchAddress) {
		this.dispatchAddress = dispatchAddress;
	}

	/**
	 * @return the pickupDeliver
	 */
	public Deliver getPickupDeliver() {
		return pickupDeliver;
	}

	/**
	 * @param pickupDeliver the pickupDeliver to set
	 */
	public void setPickupDeliver(Deliver pickupDeliver) {
		this.pickupDeliver = pickupDeliver;
	}

	/**
	 * @return the dispatchDeliver
	 */
	public Deliver getDispatchDeliver() {
		return dispatchDeliver;
	}

	/**
	 * @param dispatchDeliver the dispatchDeliver to set
	 */
	public void setDispatchDeliver(Deliver dispatchDeliver) {
		this.dispatchDeliver = dispatchDeliver;
	}

	/**
	 * @return the status
	 */
	public JobStatus getStatus() {
		return status;
	}

	/**
	 * @param status the status to set
	 */
	public void setStatus(JobStatus status) {
		this.status = status;
	}

	/**
	 * @return the tag
	 */
	public String getTag() {
		return tag;
	}

	/**
	 * @param tag the tag to set
	 */
	public void setTag(String tag) {
		this.tag = tag;
	}

	/**
	 * @return the rate
	 */
	public float getRate() {
		return rate;
	}

	/**
	 * @param rate the rate to set
	 */
	public void setRate(float rate) {
		this.rate = rate;
	}

	/**
	 * @return the comment
	 */
	public String getComment() {
		return comment;
	}

	/**
	 * @param comment the comment to set
	 */
	public void setComment(String comment) {
		this.comment = comment;
	}

	/**
	 * @return the weight
	 */
	public double getWeight() {
		return weight;
	}

	/**
	 * @param weight the weight to set
	 */
	public void setWeight(double weight) {
		this.weight = weight;
	}

	/**
	 * @return the itemAmount
	 */
	public int getItemAmount() {
		return itemAmount;
	}

	/**
	 * @param itemAmount the itemAmount to set
	 */
	public void setItemAmount(int itemAmount) {
		this.itemAmount = itemAmount;
	}

	/**
	 * @return the trackNo
	 */
	public String getTrackNo() {
		return trackNo;
	}

	/**
	 * @param trackNo the trackNo to set
	 */
	public void setTrackNo(String trackNo) {
		this.trackNo = trackNo;
	}

	/**
	 * @return the jobType
	 */
	public ItemType getItemType() {
		return itemType;
	}

	/**
	 * @param jobType the jobType to set
	 */
	public void setItemType(ItemType itemType) {
		this.itemType = itemType;
	}

	/**
	 * @return the pickupDateTime
	 */
	public Date getPickupDateTime() {
		return pickupDateTime;
	}

	/**
	 * @param pickupDateTime the pickupDateTime to set
	 */
	public void setPickupDateTime(Date pickupDateTime) {
		this.pickupDateTime = pickupDateTime;
	}

	/**
	 * @return the task
	 */
	public LogisticsTask getTask() {
		return task;
	}

	/**
	 * @param task the task to set
	 */
	public void setTask(LogisticsTask task) {
		this.task = task;
	}

}
